package com.ruoyi.rural.service.impl;

import java.util.List;
import java.util.UUID;

import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.rural.mapper.RuralBenefitAnagementMapper;
import com.ruoyi.rural.domain.RuralBenefitAnagement;
import com.ruoyi.rural.service.IRuralBenefitAnagementService;

/**
 * 救济金管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-15
 */
@Service
public class RuralBenefitAnagementServiceImpl implements IRuralBenefitAnagementService 
{
    @Autowired
    private RuralBenefitAnagementMapper ruralBenefitAnagementMapper;

    /**
     * 查询救济金管理
     * 
     * @param id 救济金管理主键
     * @return 救济金管理
     */
    @Override
    public RuralBenefitAnagement selectRuralBenefitAnagementById(String id)
    {
        return ruralBenefitAnagementMapper.selectRuralBenefitAnagementById(id);
    }

    /**
     * 查询救济金管理列表
     * 
     * @param ruralBenefitAnagement 救济金管理
     * @return 救济金管理
     */
    @Override
    public List<RuralBenefitAnagement> selectRuralBenefitAnagementList(RuralBenefitAnagement ruralBenefitAnagement)
    {
        return ruralBenefitAnagementMapper.selectRuralBenefitAnagementList(ruralBenefitAnagement);
    }

    /**
     * 新增救济金管理
     * 
     * @param ruralBenefitAnagement 救济金管理
     * @return 结果
     */
    @Override
    public int insertRuralBenefitAnagement(RuralBenefitAnagement ruralBenefitAnagement)
    {
        ruralBenefitAnagement.setId(UUID.randomUUID().toString());
        ruralBenefitAnagement.setCreateTime(DateUtils.getNowDate());
        return ruralBenefitAnagementMapper.insertRuralBenefitAnagement(ruralBenefitAnagement);
    }

    /**
     * 修改救济金管理
     * 
     * @param ruralBenefitAnagement 救济金管理
     * @return 结果
     */
    @Override
    public int updateRuralBenefitAnagement(RuralBenefitAnagement ruralBenefitAnagement)
    {
        ruralBenefitAnagement.setUpdateTime(DateUtils.getNowDate());
        return ruralBenefitAnagementMapper.updateRuralBenefitAnagement(ruralBenefitAnagement);
    }

    /**
     * 批量删除救济金管理
     * 
     * @param ids 需要删除的救济金管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralBenefitAnagementByIds(String[] ids)
    {
        return ruralBenefitAnagementMapper.deleteRuralBenefitAnagementByIds(ids);
    }

    /**
     * 删除救济金管理信息
     * 
     * @param id 救济金管理主键
     * @return 结果
     */
    @Override
    public int deleteRuralBenefitAnagementById(String id)
    {
        return ruralBenefitAnagementMapper.deleteRuralBenefitAnagementById(id);
    }

    @Override
    public List<RuralBenefitAnagement> selectRuralBenefitAnagementList1(RuralBenefitAnagement ruralBenefitAnagement) {
        return ruralBenefitAnagementMapper.selectRuralBenefitAnagementList1(ruralBenefitAnagement);
    }
}
